Oracle OLAP
Generating Views for Oracle OLAP
Release 10.2.0.3.0
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.
Copyright © 2007, Oracle. All rights reserved.
The purpose of this sample is to provide an easy way to define relational views over dimensions and cubes in an analytic workspace. The sample delivers two ways to perform this task:
The AWM plug-in requires the PL/SQL packages to define views.
Defining a relational view over an analytic workspace requires the following steps:
This sample automates the process described above.
The capabilities of AWM 10.2.0.3 may be extended using plug-ins (more details on plug-ins may be found on OTN). This sample provides an AWM plug-in that allows for the creation of views over dimensions and cubes. To create a view, simply right-click on a dimension or cube in the AWM navigator pane and select Plug-in - Create Relational View... You will be presented with the following dialog:
Select or deselect the columns that you would like to include in the view, optionally change the name of the view's column and then click Create View. A view over the selected item will be defined in the same schema as the current analytic workspace. Note: the tool uses the PL/SQL API described below to define the view.
This sample provides numerous functions and procedures to facilitate this view definition process. All of the database objects required for this sample are owned by the OLAP_VIEWS user. The code can be found in the OLAP_ViewGenerator package.
There are three procedures that create views over analytic workspace objects. You can use products like SQL Developer or SQL Plus to run these procedures. To run the procedures, log into the database as a user that has update privileges on the source analytic workspace (e.g. the owner of the AW). If you are using SQL Plus, remember to issue the command set serveroutput on in order to see progress and error messages:
The information about the views are contained in three tables. Public synonyms have been created for these tables using the simple table name:
You can generate a report of all of the views that have been created over the AW - including how columns are mapped to AW objects - by calling the following procedure: reportViewInfo (strOwner varchar2, strAWname varchar2). For example:
execute olap_views.olap_viewGenerator.reportViewInfo ('GLOBAL', 'GLOBAL_AW');
Additional procedures and functions are available to enable customization of the view definitions - either manually or by an application. These programs are called by the create view functions:
For example, if you would like to 1) change the default column names for product dimension and then 2) create a view over the dimension:
execute olap_views.olap_viewGenerator.generateDimensionMap('GLOBAL', 'GLOBAL_AW', 'PRODUCT');
update olap_mappings set column_name = xxxx ...
execute olap_views.olap_viewGenerator.createDimensionView('GLOBAL', 'GLOBAL_AW', 'PRODUCT');
There are two parts to the sample installation:
The sample installation will create the OLAP_VIEWS user and install the database objects into the schema. To install the sample, connect to the database as a user who has rights to create users and assign privileges - and run the PL/SQL script install_olap_view_generator.sql. For example:
sqlplus system/manager
SQL> @install_olap_view_generator.sql
The sample installation assumes that the database is local. If it is not local, modify the following line in the install_olap_view_generator.sql script to include the appropriate connect string:
connect olap_views/olap_views
Copy the viewGenerator.jar file to AWM Plug-in directory. Enable plug-ins and specify the plug-in directory location by selecting the AWM menu item Tools - Configuration...

Copyright © 2007 Oracle Corporation
All Rights Reserved